#include <iostream>
#include<string>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;

int main() {
	int N;
	cin >> N;
	multiset<string> collection;
	for (int i = 0; i < N; i++) {
		string str;
		cin >> str;
		collection.insert(str);
	}
	int i = 0;
	int size = collection.size();
	for (auto& item : collection) {
		if (i != size - 1)
			cout << item << endl;
		else cout << item;
	}
}
